<template>
  <h1>产品列表</h1>
  <hr>
  <Products @onReceive="handleReceive"></Products>
  <h1>购物车</h1>
  <hr>
  <Carts :product="product"></Carts>
</template>

<script>
import Products from './views/09-components/cart/Products'
import Carts from './views/09-components/cart/Carts'

export default {

  data() {
    return {
      product: null
    }
  },

  components: {
    Products,
    Carts
  },

  methods: {
    handleReceive(product) {
      this.product = {
        ...product
      }
    }
  },
}
</script>

<style lang='stylus' scoped>

</style>